#define _CRT_SECURE_NO_WARNINGS
#include"stdio.h"
void func(int arr[], int len) {
	int left = 0;
	int right= len - 1;
	while (left < right) {
		while (left < right&&arr[left] % 2 != 0) {
			left++;
		}
		while (left < right&&arr[right] % 2 == 0) {
			right--;
		}
		int temp = arr[left];
		arr[left] = arr[right];
		arr[right] = temp;
	}
}
int main() {
	int arr[] = { 1,2,3,4,5 };
	int len = sizeof(arr) / sizeof(arr[0]);
	func(arr,len);
	for (int i = 0; i < len; i++) {
		printf("%d ", arr[i]);
	}
	return 0;
}